package com.navcoo.yidaaddproapi.controller;

import com.navcoo.yidaaddproapi.service.UpdateMessageService;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 更新消息控制器
 *
 * @author Navcoo
 * @date 2024-05-13
 */
@Component
@EnableScheduling
@RequiredArgsConstructor
public class UpdateMessageController {

    private final UpdateMessageService updateMessageService;

    @Scheduled(cron = "0 0 0/3 * * ?")
    public void updateMessage() {
        System.out.println("定时任务执行");
        updateMessageService.updateMessage();
    }

}
